package com.yang.concurrency.chapter5;

/**
 * @Author: 血魔
 * @Date: Created in 17:06 2021/12/12
 * @Version: $
 */
public class SynchronizedTest {
    public final static Object LOCK = new Object();

    public static void main(String[] args) {
        Runnable runnable = () -> {
            synchronized (LOCK){
                try{
                    Thread.sleep(200*1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        };
        Thread t1 = new Thread(runnable);
        Thread t2 = new Thread(runnable);
        Thread t3 = new Thread(runnable);
        t1.start();
        t3.start();
        t2.start();
    }

}
